package com.test.sb.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


//@RestController 是@Controller 和@ResponseBody的合体
@RestController
public class HelloController {

    @Value("#{person.lastName}")
    private String name;

    @RequestMapping("/hello")
    public String sayOne(){

        return  "Hello";
    }

    @RequestMapping("/hello1")
    public String sayHello(){

        return  "Hello,"+name;
    }

    @RequestMapping("/sayhello.html")
    public @ResponseBody String say(){
        return "hello world";
    }

    @RequestMapping("/say.html")
    public @ResponseBody String say(String name){
        return "hello world "+name;
    }


}
